<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>爱奇艺-在线视频网站-海量正版高清视频在线观看</title>
    <link rel="icon" href="./image/favicon.ico">
    <style>

        
        div,i,input 
        {
            margin: 0;
            padding: 0;
        }

        .x
        {
           position: relative;
           top: -20px;
           right: -280px;
            background-image: url(./image/X号.png);
           display: inline-block;
           background-size: cover;
           width: 24px;
           height: 24px;
           background-color:#999;
           border-radius: 12px;
        }

        .login-screen
        {
            
            background-color: #111214;
            color: #666;
            width: 350px;
            height: 350px;
            box-sizing: border-box;
            padding-top: 40px;
            padding-left: 30px;
            padding-right: 30px;
            
            overflow: hidden;
            /* 设置动画 */
            transition: all .3s ease-out;
        }

        .login-screen .sigin-method
        {
           display: flex;
           justify-content: space-between;
           margin-bottom: 30px;
        }

           .login-screen .sigin-method span
           {
            cursor: pointer;
           }

        .info input
        {
            width: 280px;
            height: 40px;
            margin: 10px 0;
            border-radius: 5px;
        }

        

        .passwd i
        {
            position: relative;
            left: 240px;
            top: -45px;
            width: 24px;
            height: 24px;
            background-image: url(./image/hidden.png);
            background-size: cover;
            display: inline-block;
        }

        .help
        {
            position: relative;
            top: -30px;
            right: -200px;
        }

        .login-option
        {
            width: 280px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            color: #999;
            background-color: rgb(154, 247, 14);
            border-radius: 10px;
        }

        

    </style>

</head>
<body>

 <div class="login-screen">
    <i class="x"></i>
    <div class="sigin-method">
        <span>扫码登录</span>
        <span>短信登录</span>
        <span>密码登录</span>
    </div>
    <div class="info">
        <div class="phone-email">
            <input type="text" placeholder="请输入手机号/邮箱">
        </div>
        <div class="passwd">
            <input type="password" placeholder="请输入密码">
            <i></i>
        </div>
        <div class="help">忘记密码</div>
    </div>
    <div class="login-option">登录</div>
 </div>

   <script>
    var loginList = document.querySelectorAll("span");
    console.log(loginList);
    for(var item of loginList)
    {
        console.log(item)
        item.addEventListener("mouseenter",function()
        {
          this.style.color = '#0f5';
        })

         item.addEventListener("mouseleave",function()
        {
          this.style.color = '#666';
        })
    }

    
    var passwdEl = document.querySelector(".passwd input");
     console.log(passwdEl);
    var icon = document.querySelector(".passwd i");
    var count = 0;
    icon.onclick = function()
    {
        
       if(count++%2 == 1)
       {
         icon.style.backgroundImage = "url('./image/show.png')"
         passwdEl.type = "text";
       }
       else
       {
         icon.style.backgroundImage = "url('./image/hidden.png')"
         passwdEl.type = "password";
       }

       
    }

    //找到x号，点击后remove登录页并且要有动画效果
    var X = document.querySelector(".x");
    //找到登录页元素
    var loginEl = document.querySelector(".login-screen");
    // console.log(loginEl);
    X.onclick = function()
    {
       loginEl.style.height = 0;
       loginEl.style.paddingTop = '0';
    }

    loginEl.ontransitionend = function()
    {
        loginEl.remove();
    }

   </script>

    
</body>
</html>